package com.exchange.employee.controller;

import com.exchange.employee.dto.EsQueryDto;
import com.exchange.employee.service.EmployeeService;
import com.exchange.group.SelectGroup;
import com.exchange.utils.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RefreshScope
@RequestMapping("/system/employee")
@Api(value = "员工管理", tags = "员工管理接口")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @PostMapping("/getEmployeeList")
    @ApiOperation("查询员工信息")
    public CommonResult getEmployeeList(@RequestBody @Validated(value = SelectGroup.class) EsQueryDto queryDto){
        return employeeService.getEmployeeList(queryDto);
    }
}
